<layout name="default_layout" />
<script type="text/javascript">
db_prefix = '{$db_prefix}';
selectTableName = {$selectTableName}

function gogogo(moduleName, selectTableName, layoutName){
	
	$.post("__CONTROLLER__/creatFiles", {'moduleName' : moduleName, 'selectTableName' : selectTableName, 'layoutName' : layoutName},
		function(data){
			$('#msg').html(data);
		}
	);
}

jQuery(document).ready(function($) {
		$('#gogogo').bind("click", function(){
			moduleName = $('#moduleName').val();
			checkedBox = $('input:checked');
			selectTableName = [];
			if(db_prefix != ''){
				checkedBox.each(function(){
				selectTableName.push($(this).val().replace(db_prefix,''));
				});
			}else{
			checkedBox.each(function(){
				selectTableName.push($(this).val());
				});
			}
			layoutName = $('#layoutName').val();
			gogogo(moduleName, selectTableName, layoutName);
		});	
		
		if(selectTableName){
			$.each(selectTableName, function(i, n){
				$('input[value=' + n + ']').attr("checked",true);
			})
		}
	});

</script>
<div class="mainbar">
	<!-- Page heading -->
	<div class="page-head">
	  <h2 class="pull-left"><i class="icon-home"></i>生成模块布局</h2>

	<div class="clearfix"></div>
	</div>
	<!-- Page heading ends -->


	<!-- Matter -->

	<div class="matter">
		<div class="container">
			<div class="row">
			<div class="col-md-6">
				<div class="widget">
					<div class="widget-head">
					  <div class="pull-left" height="80">
					  生成模块
					  </div>
					  <div class="widget-icons pull-right">
						<a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> 
						<a href="#" class="wclose"><i class="icon-remove"></i></a>
					  </div>  
					  <div class="clearfix"></div>
					</div>  
					<div class="widget-content" >
					<div class="padd">
					<p>注：此步骤主要是为了生成模块目录以及布局文件需要有哪些菜单项</p>
                      <div class="form quick-post">
                                      <!-- Edit profile form (not working)-->
                                      <div class="form-horizontal">  
										<div class="form-group">
											<div class="form-group">
												<label class="control-label col-lg-3">目标模块:</label>
												<div class="col-lg-9">                               
													<select class="form-control" id="moduleName">
														<volist name="moduleNameList" id="moduleName" >
															<option value="{$moduleName}">{$moduleName}</option>
														</volist>
													</select> 
												</div>
											  </div>   
											 <!-- Table -->
											<div class="form-group">
												<label class="control-label col-lg-3">数据表:</label>
												<div class="col-lg-9">                               
													<volist name="tableNameList" id="table" >
														<input type="checkbox" name="table" value="{$table}" >{$table}</input><br>
													</volist> 
												</div>
											</div>
											<div class="form-group">
												<label class="control-label col-lg-3">布局模板:</label>
												<div class="col-lg-9">                               
													<select class="form-control" id="layoutName">
														<volist name="layoutNameList" id="layoutName" >
															<option value="{$layoutName}">{$layoutName}</option>
														</volist>
													</select>  
												</div>
											</div>
									    </div>    
                                          
                                          <!-- Buttons -->
                                          <div class="form-group">
                                             <!-- Buttons -->
											 <div class="col-lg-offset-2 col-lg-9">
												<button class="btn btn-success" id="gogogo">生成</button>
											 </div>
                                          </div>
                                      </div>
                                    </div><!--end  paddad-->
					</div>
				</div>	
				</div>	
			</div>
		</div>
		  
		 <div id="msg"></div> 
		</div><!-- container Graph end -->
	</div>
</div>